import binascii
import socket

def makepacket(number):

    
    numberstring = str(number)
    while len(numberstring)  < 4:
        numberstring = "0" + numberstring
    
    passcode = binascii.hexlify(numberstring.encode()).decode()
    packet = "45454d5030313030455bc678040000004a00000001000000001c00000000000000ffffff00455bc6640201030005200320200001ff00ff00ff00000810000000010c00000026ab9ffbdf" + passcode + "000000000000000000000000ac15c508"
    return binascii.unhexlify(packet)

target = input('Enter ip address: ')
pw = input('Enter pw: ')
port = 3620

client = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client.connect((target,3620))


client.send(makepacket(pw))
packet = client.recv(4096)
packet= binascii.hexlify(packet)
packet = packet.decode()

print(packet)

packet = packet[50]
if packet != "0":
    print("Success!")
else:
    print("Wrong pw")


client.close()




